from src.application.user import dto
from src.domain.user.aggregates import UserAggregate


def convert_active_user_entity_to_dto(user: UserAggregate) -> dto.UserDTO:
    return dto.UserDTO(
        id=user.id.value,
        tg_id=user.tg_id.value,
        username=user.username,
        email=user.email,
        is_registered=user.is_registered,
        test_proxy_acquired=user.test_proxy_acquired,
        was_registered=user.was_registered,
    )


# def convert_deleted_user_entity_to_dto(user: UserAggregate) -> dto.DeletedUserDTO:
#     if not user.deleted:
#         raise MappingError(f"User {user} isn't deleted")
#
#     return dto.DeletedUserDTO(
#         id=user.id.to_uuid(),
#         name=user.name,
#         email=str(user.email),
#     )
